﻿<%@ Page Language="C#" %>
<%@ Register TagPrefix="IRL" TagName="DatePicker" Src="DatePicker.ascx" %>
<%@ Register TagPrefix="IRL" TagName="SideBar" Src="SideBar.ascx" %>
<%@ Import Namespace="IRL.Utilities" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


<script runat="server">
    
    public const int CURRENT_MODULE = 51;
    
    int proposalID;
    bool HasWriteAccess = false;
    
    protected void Page_Load(object src, EventArgs e)
    {
        Security SysAcc = new Security(CURRENT_MODULE);
        // check is authenticate
        SysAcc.Authenticate();
        HasWriteAccess = SysAcc.IsAuthorized(2);
        
        // load reminder count        
        //Mics.loadReminderCount(lblReminderCount);

        SideBar1.loadData();                
        
        if (Request.QueryString["pid"] == null)
        {
            Response.Redirect("listProposals.aspx");
        }
        else
        {
            proposalID = Convert.ToInt32(Request.QueryString["pid"]);
            
            if (IsPostBack && HasWriteAccess)
            {
                saveData(proposalID);
            }
            else
            {
                loadData(proposalID);
            }
        }
        
        //Set SID
        SetSID();
    }

    void saveData(int proposalID)
    {
        //proposalID = int.Parse(txtProposalID.Text);
        int clientID = int.Parse(cboClientID.SelectedValue);
        string projectName = txtProjectName.Text;
        int projectType = int.Parse(cboProjectType.SelectedValue);
        int researchCategory = int.Parse(cboResearchCategory.SelectedValue);
        int researchType = int.Parse(cboResearchType.SelectedValue);
        StringBuilder researchMethodology = new StringBuilder();
        foreach (ListItem li in chkResearchMethodology.Items)
        {
            if (li.Selected)
                researchMethodology.Append(li.Value + ", ");
        }
        if (researchMethodology.Length > 0)
            if (researchMethodology[researchMethodology.Length - 2] == ',')
                researchMethodology.Remove(researchMethodology.Length - 2, 2);
        // Project data
        int forYear = int.Parse(txtYear.Text);
        string projectCode = txtProjectCode.Text;
        string respondentProfile = txtRespondentProfile.Text;
        string samplingDescription = txtSamplingDescription.Text;
        string projectObjectives = txtProjectObjectives.Text;
        string locationDetails = txtLocationDetails.Text;
        string sampleDetails = txtSampleDetails.Text;
        string[] startDate = txtStartDate.CalendarDate.Split('-');
        Array.Reverse(startDate);
        string[] endDate = txtEndDate.CalendarDate.Split('-');
        Array.Reverse(endDate);
        string timingDetails = txtTimingDetails.Text;
        string results = txtResults.Text;
        decimal costs = Convert.ToDecimal(txtCosts.Text);
        string contractNotes = txtContractNotes.Text;
        int irlContact = Convert.ToInt32(cboIRLContact.SelectedValue);
        
        // Save to database
        object connStr = ConfigurationSettings.AppSettings["sqlConn"];
        using (SqlConnection conn = new SqlConnection(connStr.ToString()))
        {
            // run store procedure
            SqlCommand cmd = new SqlCommand("sp_SaveProject", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@proposalid", SqlDbType.Int).Value = proposalID;
            cmd.Parameters.Add("@clientid", SqlDbType.Int).Value = clientID;
            cmd.Parameters.Add("@projectname", SqlDbType.NVarChar, 80).Value = projectName;
            cmd.Parameters.Add("@projecttype", SqlDbType.Int).Value = projectType;
            cmd.Parameters.Add("@researchcategory", SqlDbType.Int).Value = researchCategory;
            cmd.Parameters.Add("@researchtype", SqlDbType.Int).Value = researchType;
            cmd.Parameters.Add("@researchmethodology", SqlDbType.VarChar, 255).Value = researchMethodology.ToString();
            cmd.Parameters.Add("@projectcode", SqlDbType.Char, 6).Value = projectCode;
            cmd.Parameters.Add("@year", SqlDbType.SmallInt).Value = forYear;
            cmd.Parameters.Add("@respondentprofile", SqlDbType.VarChar, 255).Value = respondentProfile;
            cmd.Parameters.Add("@samplingdescription", SqlDbType.VarChar, 255).Value = samplingDescription;
            cmd.Parameters.Add("@projectobjectives", SqlDbType.VarChar, 255).Value = projectObjectives;
            cmd.Parameters.Add("@locationdetails", SqlDbType.VarChar, 255).Value = locationDetails;
            cmd.Parameters.Add("@sampledetails", SqlDbType.VarChar, 255).Value = sampleDetails;
            cmd.Parameters.Add("@startdate", SqlDbType.DateTime).Value = String.Join("/", startDate);
            cmd.Parameters.Add("@enddate", SqlDbType.DateTime).Value = String.Join("/", endDate);
            cmd.Parameters.Add("@timingdetails", SqlDbType.VarChar, 255).Value = timingDetails;
            cmd.Parameters.Add("@results", SqlDbType.VarChar, 255).Value = results;
            cmd.Parameters.Add("@costs", SqlDbType.Money).Value = costs;
            cmd.Parameters.Add("@contractnotes", SqlDbType.VarChar, 255).Value = contractNotes;
            cmd.Parameters.Add("@irlcontact", SqlDbType.Int).Value = irlContact;

            conn.Open();
            cmd.ExecuteNonQuery();                        
        }
        lblSaveStatus.Text = "Data is already saved to the database.<br //><br //>";
        // send email ?        
        if (Request.QueryString["confirm"] != null)
        {
            //Mics.MailSend("chanmann@indochinaresearch.com", "Proposal is confirmed", "<h1>Project: "+ projectName +"</h1>");
        }
        // redirect
        if (Request.QueryString["lm"] != null)
            Response.Redirect("listMilestones.aspx?pid=" + proposalID);
        Response.Redirect("listProjects.aspx");
    }
    
    void loadData(int proposalID)
    {
        // Control Data-Binding
        txtYear.Text = DateTime.Now.Year.ToString();
        List.fillList(cboClientID, "SELECT [Company_ID], [Company_Name] FROM [vw_Clients] ORDER BY [Company_Name];");
        List.fillList(cboProjectType, "sp_Select_cms_Lookup 'project_type'");
        List.fillList(cboResearchCategory, "sp_Select_cms_Lookup 'research_category'");
        List.fillList(cboResearchType, "sp_Select_cms_Lookup 'research_type'");
        List.fillChk(chkResearchMethodology, "sp_Select_cms_Lookup 'research_methodology', @ValueOnly=1");
        string market = "", sqlIRLContact;        
        if (Request.Cookies["office"] != null)
            market = Request.Cookies["office"].Value;
        if (market == "")
        {
            sqlIRLContact = "SELECT [id], [Title]+' '+[FirstName]+' '+[LastName] AS [Fullname] FROM [tbl_Staff] WHERE [Department]=1 ORDER BY [FirstName];";
        }
        else
        {
            sqlIRLContact = "SELECT [id], [Title]+' '+[FirstName]+' '+[LastName] AS [Fullname] FROM [tbl_Staff] WHERE [Department]=1 AND [Office_id]="+ market +" ORDER BY [FirstName];";
        }        
        List.fillList(cboIRLContact, sqlIRLContact);
        bind_rptFiles();
        // hide Controls
        if (!HasWriteAccess)
        {
            //divAddFile.Attributes.Add("class", "hidden");
            //SaveButton.Attributes.Add("class", "hidden");
            divAddFile.Visible = false;
            SaveButton.Visible = false;
        }

        // Load Proposal data                
        if (proposalID > 0)
        {
            object connStr = ConfigurationSettings.AppSettings["sqlConn"];
            using (SqlConnection conn = new SqlConnection(connStr.ToString()))
            {
                SqlCommand cmdPS = new SqlCommand("SELECT * FROM [cms_Proposals] WHERE [ProposalID]=" + proposalID.ToString() + ";", conn);
                conn.Open();
                SqlDataReader drPS = cmdPS.ExecuteReader();
                if (!drPS.Read())
                {
                    // invalid ProposalID
                    Response.Redirect("listProjects.aspx");
                }
                else
                {
                    txtProposalID.Text = drPS["ProposalID"].ToString();
                    cboClientID.SelectedValue = drPS["ClientID"].ToString();
                    txtProjectName.Text = drPS["ProjectName"].ToString();
                    cboProjectType.SelectedValue = drPS["ProjectType"].ToString();
                    cboResearchCategory.SelectedValue = drPS["ResearchCategory"].ToString();
                    string researchMethodology = drPS["ResearchMethodology"].ToString();
                    string[] arMethod = researchMethodology.Split(',');
                    foreach (string t in arMethod)
                    {
                        ListItem li = chkResearchMethodology.Items.FindByValue(t.TrimStart());
                        if (li != null)
                        {
                            li.Selected = true;
                        }
                    }
                }
                drPS.Close();

                // Load project data
                SqlCommand cmdPJ = new SqlCommand("SELECT * FROM [cms_Projects] WHERE [ProposalID]=" + proposalID, conn);
                
                SqlDataReader drPJ = cmdPJ.ExecuteReader();
                if (drPJ.Read())
                {
                    txtYear.Text = drPJ["ForYear"].ToString();
                    txtProjectCode.Text = drPJ["ProjectCode"].ToString().Trim();
                    txtRespondentProfile.Text = drPJ["RespondentProfile"].ToString();
                    txtSamplingDescription.Text = drPJ["SamplingDescription"].ToString();
                    txtProjectObjectives.Text = drPJ["ProjectObjectives"].ToString();
                    txtLocationDetails.Text = drPJ["LocationDetails"].ToString();
                    txtSampleDetails.Text = drPJ["SampleDetails"].ToString();
                    txtStartDate.CalendarDate = ((DateTime)drPJ["StartDate"]).ToString("dd-MM-yyyy");
                    txtEndDate.CalendarDate = ((DateTime)drPJ["EndDate"]).ToString("dd-MM-yyyy");
                    txtTimingDetails.Text = drPJ["TimingDetails"].ToString();
                    txtResults.Text = drPJ["Results"].ToString();
                    txtCosts.Text = String.Format("{0:#0.00}", drPJ["Costs"]);
                    txtConfirmCost.Text = txtCosts.Text;
                    txtContractNotes.Text = drPJ["ContractNotes"].ToString();
                    //cboIRLContact.SelectedValue = drPJ["IRLContact"].ToString();
                    List.setList(cboIRLContact, drPJ["IRLContact"].ToString());
                }
                drPJ.Close();                
            }
        }
    }

    void bind_rptFiles()
    {
        object connStr = ConfigurationSettings.AppSettings["sqlConn"];
        using (SqlConnection conn = new SqlConnection(connStr.ToString()))
        {
            SqlCommand cmd = new SqlCommand("SELECT * FROM cms_Files WHERE [ProposalID]=" + proposalID, conn);
            conn.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            rptFiles.DataSource = dr;
            rptFiles.DataBind();
            if (dr.HasRows)
            {
                divFiles.Attributes.Add("class", "files");
            }
            dr.Close();
        }
    }
    string showFiles(string ticks, string filename)
    {
        StringBuilder strHtml = new StringBuilder(64);
        strHtml.Append("<div id=\"" + ticks + "\"> " + filename);
        if (HasWriteAccess)
        {
            strHtml.Append(" <a class=\"blue\" href=\"javascript:removeFile('" + ticks + "')\"> Remove</a>");
        }
        strHtml.Append("</div>");

        return strHtml.ToString();
    }

    private void SetSID()
    {
        string strScript = "<script language=\"javascript\">";
        strScript += "var sid='" + Session.SessionID + "';\n";
        strScript += "var pid=" + proposalID + ";\n";
        strScript += "var fileCount=" + rptFiles.Items.Count + ";\n";
        strScript += "<";
        strScript += "/";
        strScript += "script>";
        this.RegisterClientScriptBlock("Init", strScript);
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="Description" content="Providing the tools and expertise needed to navigate in the emerging consumer markets of Indochina.">
    <meta name="keywords" content="Research in Indochina, Research Consultants in Indochina, Marketing Research in Indochina, Marketing Research Companies in Indochina, Marketing Consultants in Indochina Research in Vietnam, Research Consultants in Vietnam, Marketing Research in Vietnam, Marketing Research Companies in Vietnam, Marketing Consultants in Vietnam Research in Cambodia, Research Consultants in Cambodia, Marketing Research in Cambodia, Marketing Research Companies in Cambodia, Marketing Consultants in Cambodia Research in Laos, Research Consultants in Laos, Marketing Research in Laos, Marketing Research Companies in Laos, Marketing Consultants in Laos">
    <meta name="robots" content="all">

    <title>Indochina Research</title>
    <link type="text/css" rel="stylesheet" href="../css/global.css" />
    <link type="text/css" rel="stylesheet" href="css/cms.css" />
    <link href="cal/popcalendar.css" type="text/css" rel="stylesheet" />
    
    <script language="javascript" src="includes/ajax.js"></script>
    <script language="javascript" src="includes/file_functions.js"></script>    
        
    <script language="javascript" src="cal/popcalendar.js"></script>
    <script language="javascript" src="cal/holidays.js"></script>
    <script language="javascript" src="includes/checkDate.js"></script>
    
    
    <script type="text/javascript" language="javascript">
        
        function validateInfo(){            
            var f = document.frmProject;                                  
            
            //Initialise variables
	        var errorMsg = "";
	        var errorMsgLong = "";
            
            //check Year
            if(f.txtYear.value.length==0){
                errorMsg += "\n\tYear \t\t- You must enter Year";
            }
            
            //check StartDate
            if(f.txtStartDate_txt_Date.value.length==0){
                errorMsg += "\n\tStartDate \t- You must select StartDate";
            }else if(!isDate(f.txtStartDate_txt_Date.value)){
                errorMsg += "\n\tStartDate \t- Please enter valid StartDate";
            }
            
            //check EndDate
            if(f.txtEndDate_txt_Date.value.length==0){
                errorMsg += "\n\tEndDate \t\t- You must select EndDate";
            }else if(!isDate(f.txtEndDate_txt_Date.value)){
                errorMsg += "\n\tEndDate \t- Please enter valid EndDate";
            }
            
            //check Cost
            if(isNaN(f.txtCosts.value) || f.txtCosts.value.length==0){
                errorMsg += "\n\tCost \t\t- You must enter valid Cost";
            }else if(f.txtCosts.value!=f.txtConfirmCost.value){
                errorMsg += "\n\tConfirmCost \t- The Confirm Cost is not matched";
			    errorMsgLong += "\n- Value of Cost and Confirm Cost must be equal.";
            }
            
            //check input
            if(f.txtRespondentProfile.value.length==0){
                errorMsg = "\n\tRespondentProfile \t\t- Please input data";
            }
            if(f.txtSamplingDescription.value.length==0){
                errorMsg += "\n\tSamplingDescription \t- Please input data";
            }
            if(f.txtProjectObjectives.value.length==0){
                errorMsg += "\n\tProjectObjectives \t\t- Please input data";
            }
            if(f.txtLocationDetails.value.length==0){
                errorMsg += "\n\tLocationDetails \t\t- Please input data";
            }
            if(f.txtSampleDetails.value.length==0){
                errorMsg += "\n\tSampleDetails \t\t- Please input data";
            }
            if(f.txtTimingDetails.value.length==0){
                errorMsg += "\n\tTimingDetails \t\t- Please input data";
            }
            if(f.txtResults.value.length==0){
                errorMsg += "\n\tResults \t\t\t- Please input data";
            }
            if(f.txtContractNotes.value.length==0){
                errorMsg += "\n\tContractNotes \t\t- Please input data";
            }
                       
            //If there is aproblem with the form then display an error
	        if ((errorMsg != "") || (errorMsgLong != "")){
			        msg = "_______________________________________________________________\n\n";
			        msg += "The form has not been submitted because there are problem(s) with the form.\n";
			        msg += "Please correct the problem(s) and re-submit the form.\n";
			        msg += "_______________________________________________________________\n\n";
			        msg += "The following field(s) need to be corrected: -\n";

			        errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
			        return;
	        } 
            
            f.submit();
        }
        
        
        
        var obj_target;
        function searchClient(target){														
        	
	        obj_target = target;
        	
	        // feature var						
	        //var w=620, h=220;
	        var w=775, h=352;
	        var l=(screen.availWidth-w)/2, t=(screen.availHeight-h)/2;							
        	
	        var newWin = window.open('searchClient.aspx', 'search', 'toolbar=0,status=0,menubar=0,resizable=0,scrollbars=0,width='+ w +',height='+ h +',left='+ l +',top='+ t);
        }
    </script>
</head>
<body>
<table width="773" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td width="765" height="540" align="center" valign="top" style="border:solid 1px #10147e;" >
			<!-- header -->
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr bgcolor="#F4F4F9">
					<td colspan="3" align="right" style="padding:10px;">
						<b class="blueL">Client Management System</b>
					</td>
				</tr>
				<tr>
					<td class="wave_l">&nbsp;</td>
					<td><img src="images/wave_logo.jpg" width="107" height="83"></td>
					<td class="wave_r">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="3" style="padding:0 20px;">
						<div style="background-color:#bcb3d5; padding:5px 10px;">
							<span style="float:right">
							    <a class="blue" href="javascript:history.go(-1);">&laquo; Back</a>
							</span>
							<span class="pathmap">
								<a href="default.aspx" >CPanel</a> :: 
								<a href="default2.aspx" >Ops Files</a> :: 
								Add/Update Proposal
						    </span>
						</div>
						<br />
						
						
					</td>
				</tr>
				
			</table>
			
			<!-- body -->
			<form id="frmProject" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center" valign="top" style="padding-left:20px;">
						<table align="left" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td valign="top">
								
									<IRL:SideBar ID="SideBar1" runat="server" />
								
								</td>
								<td width="10"><img src="images/spacer.gif" width="10" height="1" /></td>
								<td valign="top">
									<asp:TextBox ID="txtProposalID" Text="0" Visible="false" runat="server" />
                                    <div align="center">
                                        <asp:Label CssClass="orange" ID="lblSaveStatus" runat="server" /></div>
                                    <table border="0" cellpadding="3" align="center">
                                        <tr>
                                            <td align="right">
                                                Year :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtYear" Columns="4" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="180" align="right">
                                                Client Name :
                                            </td>
                                            <td nowrap>
                                                <asp:DropDownList ID="cboClientID" runat="server" style="width:245px" />
                                                &nbsp; <!--<a class="blue" href="saveClient.aspx">Add new</a> &nbsp; <span style="cursor: pointer;"
                                                    onclick="searchClient('frmProject.cboClientID')">
                                                    <img src="images/icon_mini_search.gif" /></span>-->
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Project Name :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtProjectName" Columns="40" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Project Code :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtProjectCode" Columns="6" MaxLength="6" runat="server" />
                                                &nbsp; Project Type :
                                                <asp:DropDownList ID="cboProjectType" runat="server" />
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                            <td align="right">
                                                Research Category :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cboResearchCategory" runat="server" />
                                                &nbsp; Research Type :
                                                <asp:DropDownList ID="cboResearchType" runat="server" />
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                            <td align="right">
                                                Research Methodology :
                                            </td>
                                            <td class="normalSize">
                                                <asp:CheckBoxList ID="chkResearchMethodology" runat="server" CellPadding="2" RepeatLayout="table"
                                                    RepeatColumns="5" RepeatDirection="vertical" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Respondents Profile :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtRespondentProfile" TextMode="multiLine" Rows="4" Columns="62"
                                                    runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Sampling Description :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtSamplingDescription" TextMode="multiLine" Rows="4" Columns="62"
                                                    runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Project Objectives :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtProjectObjectives" TextMode="multiLine" Rows="4" Columns="62"
                                                    runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Location Details :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtLocationDetails" TextMode="multiLine" Rows="4" Columns="62" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Sample Details :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtSampleDetails" TextMode="multiLine" Rows="4" Columns="62" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Start Date :
                                            </td>
                                            <td>
                                                <IRL:DatePicker ID="txtStartDate" runat="server" />
                                                &nbsp; End Date :
                                                <IRL:DatePicker ID="txtEndDate" runat="server" />
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                            <td align="right">
                                                Timing/Duration Details :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtTimingDetails" TextMode="multiLine" Rows="4" Columns="62" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Results / Deliverables :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtResults" TextMode="multiLine" Rows="4" Columns="62" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                Costs :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtCosts" Columns="15" CssClass="num" runat="server" />
                                                <span class="fldNote">$USD</span> &nbsp; Confirm :
                                                <asp:TextBox ID="txtConfirmCost" Columns="15" CssClass="num" runat="server" />
                                                <span class="fldNote">$USD</span>
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                            <td align="right">
                                                Cost and Contract Notes :
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtContractNotes" TextMode="multiLine" Rows="4" Columns="62" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                IRL Contact :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="cboIRLContact" runat="server" /></td>
                                        </tr>
                                        <tr>
                                            <td align="right" valign="top">
                                                Associated Files:</td>
                                            <td width="360">
                                                <div id="divFiles" runat="server">
                                                    <asp:Repeater ID="rptFiles" runat="server">
                                                        <ItemTemplate>
                                                            <%# showFiles(DataBinder.Eval(Container.DataItem, "Ticks").ToString(), DataBinder.Eval(Container.DataItem, "Filename").ToString())%>
                                                            
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </div>
                                                <div id="divAddFile" runat="server">
                                                    <a class="blue" href="javascript:showCtrl();">Add file</a></div>
                                                <div id="divCtrl" class="hidden">
                                                    <iframe name="fraUpload" frameborder="0" scrolling="no" width="100%" height="22"
                                                        src="add_file.aspx?pid=<%=proposalID %>"></iframe>
                                                </div>
                                                <div id="divStat" class="hidden">
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                &nbsp;
                                            </td>
                                            <td>
                                                <table id="SaveButton" border="0" cellpadding="2" cellspacing="0" runat="server">
                                                    <tr>
                                                        <td width="128">
                                                            <a class="cmd" href="javascript:validateInfo();">Save Project</a></td>
                                                        <td width="5">
                                                            &nbsp;
                                                        </td>
                                                        <td width="80">
                                                            <a class="cmd" href="javascript:history.go(-1);">Cancel</a></td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</form>
			
		</td>
		
		<td width="6" class="rightShadow" valign="top">
			<img src="images/white.gif" width="6" height="6" /></td>
	</tr>
	
	<!-- bottom shadow -->
	<tr>
		<td height="6" class="bottomShadow">
			<img src="images/white.gif" width="6" height="6" /></td>
		
		<td width="6" height="6">
			<img src="images/shadow_corner.gif" width="6" height="6" /></td>
	</tr>
</table>


</body>
</html>
